/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI;

import LN.CControladorInstancias;
import javax.swing.JOptionPane;

/**
 *
 * @author HELIOS
 */
public class FPrincipal extends javax.swing.JFrame {

    /**
     * Creates new form FPrincipal
     */
    private int cuenta;

    public int getCuenta() {
        return this.cuenta;
    }

    public void setCuenta(int cuenta) {
        this.cuenta = cuenta;
    }

    public FPrincipal() {
        cuenta = 0;
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenu2 = new javax.swing.JMenu();
        DPContenedor = new javax.swing.JDesktopPane();
        MBBarra = new javax.swing.JMenuBar();
        MPrincipal = new javax.swing.JMenu();
        MISalir = new javax.swing.JMenuItem();
        MProfesores = new javax.swing.JMenu();
        MIRegProfesores = new javax.swing.JMenuItem();
        MFacultades = new javax.swing.JMenu();
        MAyuda = new javax.swing.JMenu();
        MAcercaDe = new javax.swing.JMenuItem();

        jMenu2.setText("jMenu2");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("SIProFI: Sistema de Profesores Activos en Fundación INCAP");
        setAlwaysOnTop(true);
        setName("FPrincipal");
        setResizable(false);

        MPrincipal.setText("Principal");
        MPrincipal.setToolTipText("Menú principal");

        MISalir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.event.InputEvent.ALT_MASK));
        MISalir.setText("Salir");
        MISalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MISalirActionPerformed(evt);
            }
        });
        MPrincipal.add(MISalir);

        MBBarra.add(MPrincipal);

        MProfesores.setText("Profesores");

        MIRegProfesores.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        MIRegProfesores.setText("Registro de profesores");
        MIRegProfesores.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MIRegProfesoresActionPerformed(evt);
            }
        });
        MProfesores.add(MIRegProfesores);

        MBBarra.add(MProfesores);

        MFacultades.setText("Facultades");
        MBBarra.add(MFacultades);

        MAyuda.setText("Ayuda");

        MAcercaDe.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0));
        MAcercaDe.setText("Acerca de");
        MAcercaDe.setToolTipText("Ver los créditos");
        MAcercaDe.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MAcercaDeActionPerformed(evt);
            }
        });
        MAyuda.add(MAcercaDe);

        MBBarra.add(MAyuda);

        setJMenuBar(MBBarra);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(DPContenedor, javax.swing.GroupLayout.PREFERRED_SIZE, 959, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(DPContenedor, javax.swing.GroupLayout.DEFAULT_SIZE, 519, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void MISalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MISalirActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_MISalirActionPerformed

    private void MAcercaDeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MAcercaDeActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_MAcercaDeActionPerformed

    private void MIRegProfesoresActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MIRegProfesoresActionPerformed
        // TODO add your handling code here:
        if (CControladorInstancias.getNumVentanasRegProf() == 0) {
            FRegistroProfesores frp = new FRegistroProfesores();
            DPContenedor.add(frp);
            CControladorInstancias.abrirVentanaRegP();
            frp.setVisible(true);
        } else {
            JOptionPane.showMessageDialog(this, "Cierre la ventana activa de registro de profesor");
        }
    }//GEN-LAST:event_MIRegProfesoresActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(FPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(FPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(FPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(FPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new FPrincipal().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JDesktopPane DPContenedor;
    private javax.swing.JMenuItem MAcercaDe;
    private javax.swing.JMenu MAyuda;
    private javax.swing.JMenuBar MBBarra;
    private javax.swing.JMenu MFacultades;
    private javax.swing.JMenuItem MIRegProfesores;
    private javax.swing.JMenuItem MISalir;
    private javax.swing.JMenu MPrincipal;
    private javax.swing.JMenu MProfesores;
    private javax.swing.JMenu jMenu2;
    // End of variables declaration//GEN-END:variables
}
